package com.cm.stock.manager.dto;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Entity
@Table(name = "articlecommande")
public class ArticleCommandeDTO implements Serializable{

	@Id
	@Column(name = "ID", nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int id;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "commande_Id",nullable=false)
	private CommandeDTO commande;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "article_Id",nullable=false)		
	private ArticleDTO article;
	private int quantite;
	private double prixUnitaire;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public CommandeDTO getCommande() {
		return commande;
	}
	public void setCommande(CommandeDTO commande) {
		this.commande = commande;
	}
	public ArticleDTO getArticle() {
		return article;
	}
	public void setArticle(ArticleDTO article) {
		this.article = article;
	}
	public int getQuantite() {
		return quantite;
	}
	public void setQuantite(int quantite) {
		this.quantite = quantite;
	}
	public double getPrixUnitaire() {
		return prixUnitaire;
	}
	public void setPrixUnitaire(double prixUnitaire) {
		this.prixUnitaire = prixUnitaire;
	}
	public ArticleCommandeDTO() {
		super();
	}
	public ArticleCommandeDTO(CommandeDTO commande, ArticleDTO article,
			int quantite, double prixUnitaire) {
		super();
		this.commande = commande;
		this.article = article;
		this.quantite = quantite;
		this.prixUnitaire = prixUnitaire;
	}	
	
}
